package com.nbufe.command.demo1;

/**
 * @Author Zan
 * @Create 2024/6/3 8:29
 * @ClassName: FunctionButton
 * @Description : 窗口按钮
 */
public class FunctionButton {

    private Command command;

    private String name;

    public FunctionButton(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setCommand(Command command) {
        this.command = command;
    }

    /**Co
     * 点击按钮，发出命令
     */
    public void onClick() {
        System.out.println("点击功能键：");
        command.execute();
    }
}
